<?php
require_once("../includes/config.inc.php");
validate_admin();

if($_POST)
{
	@extract($_POST);
	if(is_array($chkIds))
	{
		$strIds =  @implode(",",$chkIds);
		
		if($Submit == 'Active')
		{
			$sqlA = " update tbl_pages set status = 1 where pageId in ($strIds) ";
			executeQuery($sqlA);
			$_SESSION['sessMsg'] = " Selected Record(s) Are Now Active. ";
			header("location:adminPageManager.php");
			exit();
		}
		if($Submit =='delete')
		{
		$sqlqr="delete from tbl_pages where pageId in ($strIds)";
		executeQuery($sqlqr);
		$_SESSION['sessMsg'] = " Selected Record(s) Are Now deleted. ";
		header("location: adminPageManager.php");
			exit();
	
		}
		
		if($Submit == 'Inactive')
		{
			$sqlA = " update tbl_pages set status = 0 where pageId in ($strIds) ";
			executeQuery($sqlA);
			$_SESSION['sessMsg'] = " Selected Record(s) Are Now Inactive. ";
			header("location: adminPageManager.php");
			exit();
		}
		
		
	}
	else
	{
		$_SESSION['sessMsg'] = " Please select at least one checkbox for desire action. ";
		header("location: adminPageManager.php");
		exit;
	}
}

$sqlPL = " select * from tbl_pages order by pageId asc ";
$resPL = executeQuery(dopaging($sqlPL,10));
//$resPL = executeQuery($sqlPL);

?>
